<template>
  <div class="mask-box">
    <div class="pass-box">
      <img v-if="type=='success'"class="default-img" src="/static/shareSuccess.png">
      <img v-if="type=='ten'" class="default-img" src="/static/ten.png" alt="">
      <img v-if="type=='fail'" class="default-img" src="/static/shareFail.png">

      <img class="close" src="/static/close.png" @click="closeHandle">
      <div v-if="type=='success'" class="title">回答正确</div>
      <div v-if="type=='ten'" class="title">解锁成功</div>
      <div v-if="type=='fail'" class="title">回答错误</div>
      
      <div v-if="type=='success'" class="desc">
        你已帮<div class="color">{{user.nickname}}</div>
        解锁了<div class="color">{{card}}</div>
        关
        </div>
      <div v-if="type=='ten'" class="desc">你已帮<div class="color">{{user.nickname}}</div>解锁<div class="color">{{card}}</div>关</br>你真是大好人呐</div>
      <div v-if="type=='fail'" class="desc"><div class="color">{{user.nickname}}</div>还困在<div class="color">{{card}}</div>关</br>通过<div class="color">10</div>关可以帮TA过关哦</div>

      <div class="btn-box">
        <div v-if="type=='success'" class="btn-right" @click="rightClickHandle">我知道了</div>
        <div v-if="type=='ten'" class="btn-right" @click="rightClickHandle">确定</div>
        <div v-if="type=='fail'" class="btn-right" @click="rightClickHandle">去救TA</div>
      </div>
    </div>
  </div>
</template>

<script>
import { mapState, mapMutations } from "vuex";
export default {
  props:["type","user","card"],
  data() {
    return {
  
    };
  },
  computed: {
    ...mapState(["sysConfig"]),

  },
  methods: {
    leftClickHandle() {
      this.$emit("leftClick");
    },
    rightClickHandle() {
      this.$emit("rightClick");
    },
    closeHandle() {
      this.$emit("close");
    }
  }
};
</script>

<style lang="scss" scoped>
.color{
  color:#e55f80;
  display: inline;
  margin-left: -6rpx;
}
.table,.tr,.td{
  display: flex;
  justify-content: center;
  align-items: center;
  align-items: stretch;
}
.table{
  width: 470rpx;
  margin: 0 auto 32rpx;
  flex-wrap: wrap;
  border: 2rpx solid #d6d6d6;
  border-bottom: 0;
  color: #949191;
}
.tr{
  .td{
    flex-wrap: wrap;
    width: 230rpx;
    padding: 12rpx 30rpx;
    box-sizing: border-box;
    line-height: 1.5em;
    align-items: center;
    font-size: 28rpx;
    border-bottom: 2rpx solid #d6d6d6;
    border-left: 2rpx solid #d6d6d6;
    &:nth-of-type(2n+1){
      border-left: 0;
    }
    img{
      width: 56rpx;
      height: 56rpx;
      margin-right: 6rpx;
    }
  }
}
.mask-box {
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  position: fixed;
  z-index: 10;
  background: rgba(#000, 0.4);
}
.pass-box {
  box-sizing: border-box;
  width: 590rpx;
  padding: 166rpx 38rpx 40rpx 38rpx;
  background: #000;
  position: absolute;
  background: #fff;
  border-radius: 8rpx;
  text-align: center;
  z-index: 15;
  left: 50%;
  top: 200rpx;
  transform: translateX(-50%);
  // &:after {
  //   width: 260rpx;
  //   height: 260rpx;
  //   background: #fff;
  //   position: absolute;
  //   left: 50%;
  //   transform: translateX(-50%);
  //   top: -84rpx;
  // }
}
.default-img,
.img-box {
  width: 260rpx;
  height: 260rpx;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: -84rpx;
}
.img-box {
  width: 240rpx;
  height: 240rpx;
  top: -74rpx;
  border-radius: 50%;
  overflow: hidden;
  img {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }
}
.title {
  font-size: 48rpx;
  line-height: 1;
  padding: 32rpx 0;
  text-align: center;
  color: #e55f80;
}
.desc {
  font-size: 30rpx;
  line-height: 1.4em;
  color: #aaaaaa;
  margin-bottom: 42rpx;
  text-align: center;
}
.btn-box {
  display: flex;
  justify-content: center;
}
.btn-left,
.btn-right {
  width: 450rpx;
  height: 92rpx;
  font-size: 36rpx;
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 3rpx solid #e55f80!important;
  color: #e55f80;
  border-radius: 4rpx;
  background: #e55f80;
  padding: 0;
}
.btn-left {
  background: transparent;
  margin-right: 28rpx;
}
.btn-right {
  color: #fff;
  // height: 66rpx;
  margin: 0;
}
.close {
  position: absolute;
  right: 20rpx;
  top: 20rpx;
  width: 48rpx;
  height: 48rpx;
}
</style>
